<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        function biaobai(god) {
            return new Promise(resolve => {
                console.log(`邓哥向${god}发出了表白短信`);
                setTimeout(() => {
                    if (Math.random() < 0.1) {
                        //女神同意拉
                        resolve(true)
                    } else {
                        //resolve
                        resolve(false);
                    }
                }, 3000);
            })
        }

        biaobai("女神1").then(result => {
            console.log(result);
        })
    </script>
</body>

</html>